package org.xianyu.commom;

import java.util.List;

/**
 * 通用分页返回对象
 * @param <T> 行对象类型
 */
public class PageResult<T> {
    private long total;     // 总记录数
    private int page;       // 当前页（从1开始）
    private int size;       // 每页大小
    private List<T> rows;   // 当前页的行

    public PageResult() {}

    public PageResult(long total, int page, int size, List<T> rows) {
        this.total = total;
        this.page = page;
        this.size = size;
        this.rows = rows;
    }

    public long getTotal() { return total; }
    public void setTotal(long total) { this.total = total; }

    public int getPage() { return page; }
    public void setPage(int page) { this.page = page; }

    public int getSize() { return size; }
    public void setSize(int size) { this.size = size; }

    public List<T> getRows() { return rows; }
    public void setRows(List<T> rows) { this.rows = rows; }
}
